{extend name="base" /}
{block name="title"}{$document.title} - 雨晴抑郁症生活{/block}
{block name="keywords"}{$document.keywords}{/block}
{block name="description"}{$document.description}{/block}
{block name="content"}
<div class="col-sm-8">
    <article class="post">
        <div class="post-head">
            <h1 class="post-title">{$document.title}</h1>
            <div class="post-meta">
                <span class="author">作者：<a href="javascript:void(0)">{$document.author}</a></span> •
                <time class="post-date" datetime="{$document.create_time|date="Y年m月d日 H时i分s秒",###}" title="{$document.create_time|date="Y年m月d日 H时i分s秒",###}">{$document.create_time|date="Y年m月d日",###}</time>
                <span>来源：<a href="javascript:void(0)">{$document.from}</a></span>
                <span>访问量：{$document.view}</span>
            </div>
        </div>
        <div class="post-content">
            <p class="text-danger">免责声明:本站所有文章均由抑郁症患者和其它热心网友提供,不能取代专业医疗咨询机构意见.如病情严重,请及时到各地正规机构寻求帮助.</p>
            <p>
                {$document.content|default=""}
            </p>
        </div>
    </article>
</div>
{/block}
{block name="jsfoot"}
<!--<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>-->
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!--<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>-->

<script type="text/javascript">

    wx.config({
        debug: false,
        appId: '{$sign.appId}',
        timestamp: '{$sign.timestamp}',
        nonceStr: '{$sign.nonceStr}',
        signature: '{$sign.signature}',
        jsApiList: [
            'checkJsApi',
            'updateAppMessageShareData',
            'updateTimelineShareData',
            'onMenuShareWeibo',
            'hideMenuItems',
            'getLocation'
        ]
    });


    var shareTitle = "{$data.title}";
    var shareDesc = "{$data.description}";
    var currentLink = "{$sign.url}";
    var shareLink = currentLink;
    var shareImgUrl = "https://www.lightrain.org.cn/fanxingylqx.png";
    var shareGid = "";

    wx.ready(function () {
        //自定义“分享给朋友”及“分享到QQ”按钮的分享内容
        wx.updateAppMessageShareData({
            title: shareTitle,
            desc: shareDesc,
            link: shareLink,
            imgUrl: shareImgUrl,
            success: function (res) {
                shared(shareLink, "friend", shareGid);
            },
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        });
        //自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容
        wx.updateTimelineShareData({
            title: shareTitle,
            desc: shareDesc,
            link: shareLink,
            imgUrl: shareImgUrl,
            success: function (res) {
                shared(shareLink, "Timeline", shareGid);
            },
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        });
        //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口
        wx.onMenuShareWeibo({
            title: shareTitle,
            desc: shareDesc,
            link: shareLink,
            imgUrl: shareImgUrl,
            success: function (res) {
                shared(shareLink, "QQ", shareGid);
            },
            cancel: function (res) {
                alert(JSON.stringify(res));
            }
        });

    });

    function shared(url, type, gid){

    }
</script>
{/block}
